//
//  SportModel.h
//  GetFit3.0
//
//  Created by zorro on 2017/7/21.
//  Copyright © 2017年 lxc. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface SportModel : NSObject

@property (nonatomic, strong) NSString *user_id;
@property (nonatomic, strong) NSString *mac;
@property (nonatomic, strong) NSString *dateString;
@property (nonatomic, assign) BOOL     isSaveAllDay;   // 是否保存了全天

@property (nonatomic, assign) NSInteger dayOfWeek;
@property (nonatomic, assign) NSInteger dayOfMonth;
@property (nonatomic, assign) NSInteger weekCount;     // 当前星期
@property (nonatomic, assign) NSInteger monthCount;    // 当前月份
@property (nonatomic, assign) NSInteger yearCount;     // 当前年份
//计步
@property (nonatomic, strong) NSArray   *stepArray;    // 步数详情 每30分钟
@property (nonatomic, strong) NSArray   *calorArray;   // 卡路里详情 每30分钟
@property (nonatomic, strong) NSArray   *distanceArray;// 距离详情 每30分钟
@property (nonatomic, assign) NSInteger step;          // 总步数
@property (nonatomic, assign) NSInteger calory;        // 总消耗卡路里
@property (nonatomic, assign) NSInteger distance;      // 总距离
@property (nonatomic, assign) NSInteger realDistance;  // 实时距离
@property (nonatomic, assign) NSInteger stepDuration;  // 总运动时间
@property (nonatomic, assign) NSInteger stepFinish;
@property (nonatomic, assign) NSInteger stepTarget;
@property (nonatomic, assign) NSInteger stepBoolFinish; //默认 0
@property (nonatomic, assign) BOOL      stepquality;   // 是否达标 (当前总步数>= 用户设置目标步数)

@property (nonatomic, strong) NSString *detailData;    // 详细数据

+ (SportModel *)initWithDate:(NSDate *)date;
+ (SportModel *)getSportModelFromDB; // 获取今天的本地运动
+ (SportModel *)getSportModelFromDBWith:(NSDate *)date;
+ (SportModel *)getSportModelFromDBWithDayString:(NSString *)string;
- (void)        updateToDBSafely;
- (void)updateRealStepData:(NSData *)data;
// 步数大数据
+ (void)updateSportData:(NSData *)sportData;
+ (void)sportTransEnd;
+(void)getMaxDayStep;
+(void)getmaxContinueDays;
+(void)getMaxWeekStep;
+(void)getMaxMonthStep;

//同步下载数据需要的
+ (NSInteger)localSportDays;
- (void)saveToDBByDownload;

@end

